package com.example.understand_compose1.fet_xuiusage

import android.os.Bundle
import android.widget.Toast
import androidx.activity.enableEdgeToEdge
import androidx.appcompat.app.AppCompatActivity
import androidx.core.view.ViewCompat
import androidx.core.view.WindowInsetsCompat
import com.example.understand_compose1.R
import com.example.understand_compose1.databinding.ActivityFetMaterialButtonToggleGroupBinding

class FetMaterialButtonToggleGroupActivity : AppCompatActivity() {
    lateinit var binding: ActivityFetMaterialButtonToggleGroupBinding

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        enableEdgeToEdge()

        binding = ActivityFetMaterialButtonToggleGroupBinding.inflate(layoutInflater)
        setContentView(binding.root)

        ViewCompat.setOnApplyWindowInsetsListener(findViewById(R.id.main)) { v, insets ->
            val systemBars = insets.getInsets(WindowInsetsCompat.Type.systemBars())
            v.setPadding(systemBars.left, systemBars.top, systemBars.right, systemBars.bottom)
            insets
        }

        binding.mbtg1.addOnButtonCheckedListener { group, checkedId, isChecked ->
            Toast.makeText(this@FetMaterialButtonToggleGroupActivity, checkedId.toString(), Toast.LENGTH_SHORT).show()
        }

    }
}